package com.biz.primus.app.customercenter.feign.customercenter;

import com.biz.primus.base.vo.PageResult;
import com.biz.primus.base.vo.PromotionBasicInfoVo;
import com.biz.primus.base.vo.commodity.ProductListItemVo;
import com.biz.primus.model.customercenter.vo.request.*;
import com.biz.primus.model.customercenter.vo.response.*;
import com.biz.primus.model.oms.vo.OmsHistoryOrderProductVo;
import com.biz.primus.model.oms.vo.OmsItemVo;
import com.biz.primus.model.oms.vo.OmsOrderRespVo;
import com.biz.primus.model.oms.vo.OmsOrderVo;
import com.biz.primus.model.promotion.vo.req.ProductPromotionReqVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author jun.liu
 * @since 2017年11月15日
 * @usage
 * @reviewer
 */
@FeignClient(qualifier = "customerCenterFeignClient", name = "service-customer-center") //, fallback = DegradedCustomerCenterFeignClient.class)
public interface CustomerCenterFeignClient
{

    /** 带有Object[]数组信息需要完善返回值  带有Object ...数组信息的需要完善请求参数*/

    /**
     * 根据手机号码判断是否是系统会员
     * @param vo
     */
    @PostMapping("soa/customerCenterService/isSysMemberByMobile")
    SysMemberResponseVo isSysMemberByMobile(@RequestBody IfSysMemberRequestVo vo);

    /**
     * 根据会员绑定手机号码获取会员信息
     * @param vo
     */
    @PostMapping("soa/customerCenterService/getMemberInfoByMobile")
    MemberInfoResponseVo getMemberInfoByMobile(@RequestBody MemberInfoRequestVo vo);

    /**
     * 根据手机号码注册为系统会员
     * @param vo
     */
    @PostMapping("soa/customerCenterService/registerByMobile")
    RegistrMemberResponseVo registerByMobile(@RequestBody IfRegMemberRequestVo vo);

    /**
     * 根据会员id查询会员地址列表 是否需要分页 分页增加分页参数
     * 按照新增地址时间倒序排列
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/getMemberAddressItem")
    List<MemberAddressItemInfoResponseVo> getMemberAddressItem(@RequestBody MemberAddressItemInfoPageRequestVo vo);

    /**
     * 新增收货地址 考虑是否要设置默认
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/addMemberAddessInfo")
    AddMemberAddressResponseVo addMemberAddessInfo(@RequestBody AddMemberAddressRequestVo vo);

    /**
     * 根据会员id获取针对会员推荐的商品
     * 按照下单购买时间倒序排列
     * @param vo
     * @return
     *
     */
    @PostMapping("soa/customerCenterService/getMemberRecommendProductItem")
    List<RecommendProductResponseVo> getMemberRecommendProductItem(@RequestBody RecommendProductItemInfoRequestVo vo);

    /**
     * 根据关键字模糊查询商品
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/findProductBykeyword")
    PageResult<ProductListItemVo> findProductBykeyword(@RequestBody SearchKeywordProductRequestVo vo);

    /**
     * 根据商品信息查询相似的商品（和查询推荐商品一致 只是查询的枚举选择相似的）
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/findSimilarityProductByProductInfo")
    List<SimilarityProductResponseVo> findSimilarityProductByProductInfo(@RequestBody SearchSimilarityProductRequestVo vo);

    /**
     * 根据会员id获取会员购买过的商品 是否需要分页 分页增加分页参数
     * 按照购买时间倒序排列
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/getMemberBuyProductItem")
    PageResult<OmsHistoryOrderProductVo> getMemberBuyProductItem(@RequestBody BuyProductItemInfoPageRequestVo vo);

    /**
     * 根据请求商品信息查询可用的促销活动
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/getPromotionsInfoByProductInfo")
    List<ProductPromotionsInfoResponseVo> getPromotionsInfoByProductInfo(@RequestBody BuyProductRequestVo vo);

    /**
     * 根据会员信息获取会员所下的历史订单
     * 按照下单时间倒序排列
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/getHistoryOrderByMemberInfo")
    PageResult<OmsOrderVo> getHistoryOrderByMemberInfo(@RequestBody HistoryOrderPageRequestVo vo);

    /**
     * 订单详情
     * @param orderCode
     * @return
     */
    @GetMapping("soa/customerCenterService/getOrderDetail")
    @ApiOperation("获取订单详情信息")
    OmsOrderRespVo getOrderDetail(@ApiParam(value = "订单编码", required = true) @RequestParam("orderCode")
                                          String orderCode);




    /**
     * 购物车的信息请在前端做操作
     */

    /**
     * 根据会员信息（会员所在的经纬度）查询辐射范围内的门店
     * @param memberInfo
     * @return
     */
    @PostMapping("soa/customerCenterService/getDeptInfoByMemberInfo")
    Object[] getDeptInfoByMemberInfo(Object ... memberInfo);

    /**
     * 根据渠道获取支付方式列表（客服中心前端可以不传递 可默认写死渠道）
     * @param vo
     * @return
     */
    @PostMapping("soa/customerCenterService/getPaymentItemByChannelCode")
    List<PaymentResponseVo> getPaymentItemByChannelCode(@RequestBody PaymentRequestVo vo);

    /**
     * 根据会员信息获取可用优惠卷列表
     *
     * 后面询问冯小春
     * @param memberInfo
     * @return
     */
    @PostMapping("soa/customerCenterService/getCouponsItemByMemberInfo")
    Object[] getCouponsItemByMemberInfo(Object ... memberInfo);

    /**
     * 根据渠道获取配送方式（客服中心前端可以不传递 可默认写死渠道）
     *
     * 后面询问开发配送app的
     * @param channelCode
     * @return
     */
    @PostMapping("soa/customerCenterService/getDistributionInByMemberInfo")
    Object[] getDistributionInByChannelCode(String channelCode);

    /**
     * 获取配送优先级
     * @return
     */
    @PostMapping("soa/customerCenterService/getDistributionPriority")
    Object[] getDistributionPriority();

    /**
     * 根据渠道获取运费（客服中心前端可以不传递 可默认写死渠道）
     * @param channelCode
     * @return
     */
    @PostMapping("soa/customerCenterService/getOrderFreightByChannelCode")
    Integer getOrderFreightByChannelCode(String channelCode);

    /**
     * 关单请在前端操作
     */

    /**
     * 下单
     * @param placeOrderInfo
     * @return
     */
    @PostMapping("soa/customerCenterService/placeOrder")
    Object[] placeOrder(Object ... placeOrderInfo);

    /**
     * 确认订单
     * @param confirmOrderInfo
     * @return
     */
    @PostMapping("soa/customerCenterService/placeOrder")
    Object[] confirmOrder(Object ... confirmOrderInfo);

    /**
     * 获取省市区
     */


}
